package cn.edu.hstc.wm.ui;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.TextView;
import cn.edu.hstc.wm.AppConfigs;
import cn.edu.hstc.wm.R;
import cn.edu.hstc.wm.ui.base.BaseActivity;

public class UserRegistDialog extends BaseActivity {

	private WebView mWebView;

	public void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		setContentView(R.layout.user_regist);
		initActionbar();
		
		initWebView();
	}

	private void initActionbar() {
		((ImageButton) findViewById(R.id.ib_actionbar_back)).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		((TextView) findViewById(R.id.tv_actionbar_title)).setText("用户注册");
	}

	@SuppressLint("SetJavaScriptEnabled")
	private void initWebView() {
		mWebView = (WebView) findViewById(R.id.register_webview);

		mWebView.requestFocusFromTouch();
		mWebView.requestFocus();
		WebSettings settings = mWebView.getSettings();
		settings.setJavaScriptEnabled(true);// 启用js调用
		mWebView.loadUrl(AppConfigs.USER_REGISTER_URL);
	}
}
